home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_patchkit.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  96 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_PatchKit.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. cog        talkCog                    local
  18.  
  19. sound    foundSnd=INXJ241.wav    local
  20.  
  21. thing    player                    local
  22.  
  23. int        bin=56                    local
  24.  
  25. int        bUnderwater                local
  26.  
  27. end
  28.  
  29. # ===================================================================
  30.  
  31. code
  32.  
  33. activated:
  34.  
  35.     player = GetSourceRef();
  36.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  37.  
  38.     StartCutscene(0);
  39.  
  40.     if (!bUnderwater)
  41.     {
  42.         talkCog = GetCogByIndex(0);
  43.         SendMessage(talkCog, 27);
  44.     }
  45.  
  46.     if (Rand() < 0.5)
  47.     {
  48.         SetExtCamOffset('0.15 -0.05 0.04');
  49.     }
  50.     else
  51.     {
  52.         SetExtCamOffset('-0.15 -0.05 0.04');
  53.     }
  54.     SetExtCamLookOffset('0.0 0.02 -0.01');
  55.  
  56.     return;
  57.  
  58. # -------------------------------------------------------------------
  59.  
  60. touched:
  61.  
  62.     player = GetSourceRef();
  63.  
  64.     if (GetInv(player, bin) < GetInvMax(player, bin))
  65.     {
  66.         TakeItem(GetSenderRef(), player);
  67.     }
  68.     else
  69.     {
  70.         EndCutscene();
  71.     }
  72.     
  73.     return;
  74.  
  75. # -------------------------------------------------------------------
  76.  
  77. taken:
  78.  
  79.     player = GetSourceRef();
  80.  
  81.     ChangeInv(player, bin, 1.0);
  82.     SetInvAvailable(player, bin, 1);
  83.     SetInvDisabled(player, bin, 1);
  84.     JonesInvItemChanged(bin);
  85.  
  86.     Sleep(1.0);
  87.  
  88.     if (!bUnderwater)
  89.         PlayVoice(player, foundSnd, 1.0, 0);
  90.  
  91.     EndCutscene();
  92.  
  93.     return;
  94.  
  95. end
  96.